Also reorder menu when reordering tabs by drag & drop (Bug #506474)
authorJohannes Schmid <jhs@gnome.org>
Mon, 31 Dec 2007 16:26:18 +0000 (16:26 +0000)
committerJohannes Schmid <jhs@src.gnome.org>
Mon, 31 Dec 2007 16:26:18 +0000 (16:26 +0000)
2007-12-30  Johannes Schmid <jhs@gnome.org>

        * gtk/gtknotebook.c: (gtk_notebook_stop_reorder):
        Also reorder menu when reordering tabs by drag & drop
        (Bug #506474)

        * tests/testnotebookdnd.c: (create_notebook_with_notebooks):
        Add a menu to one of the notebooks to have a test-case for
        the change mentioned above.

svn path=/trunk/; revision=19294

ChangeLog
gtk/gtknotebook.c
tests/testnotebookdnd.c

index d790a88db6e16e5e4270c68b11de01eb1a6763b9..7169b66b635d61a4fa1a52bf4d620f3b72efa665 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2007-12-30  Johannes Schmid <jhs@gnome.org>
+
+       * gtk/gtknotebook.c: (gtk_notebook_stop_reorder):
+       Also reorder menu when reordering tabs by drag & drop
+       (Bug #506474)
+       
+       * tests/testnotebookdnd.c: (create_notebook_with_notebooks):
+       Add a menu to one of the notebooks to have a test-case for
+       the change mentioned above.
+
 2007-12-31  Philip Van Hoof  <pvanhoof@gnome.org>
 
         * gtk/gtktreemodel.c: Using GSlice for GtkTreePath
index 4f5e1dd857e965edc54c369cab9cdbe310c43e31..846502c8c406d1e539006236e5c323c8b73d64f1 100644 (file)
@@ -352,6 +352,8 @@ static GList * gtk_notebook_search_page      (GtkNotebook      *notebook,
                                              GList            *list,
                                              gint              direction,
                                              gboolean          find_visible);
+static void  gtk_notebook_child_reordered    (GtkNotebook      *notebook,
+                                             GtkNotebookPage  *page);
 
 /*** GtkNotebook Drawing Functions ***/
 static void gtk_notebook_paint               (GtkWidget        *widget,
@@ -2765,7 +2767,8 @@ gtk_notebook_stop_reorder (GtkNotebook *notebook)
          element = get_drop_position (notebook, page->pack);
          old_page_num = g_list_position (notebook->children, notebook->focus_tab);
          page_num = reorder_tab (notebook, element, notebook->focus_tab);
-
+          gtk_notebook_child_reordered (notebook, page);
+          
          if (priv->has_scrolled || old_page_num != page_num)
            g_signal_emit (notebook,
                           notebook_signals[PAGE_REORDERED], 0,
index 869439469ddfa027b67b572cc0822ce4f6938680..04a4aef5dc7ab4d0ecf2a79cf411a32366469a2d 100644 (file)
@@ -201,13 +201,14 @@ create_notebook_with_notebooks (gchar           **labels,
   while (*labels)
     {
       page = create_notebook (labels, group, packing, pos);
-
+      gtk_notebook_popup_enable (GTK_NOTEBOOK (page));
+      
       title = gtk_label_new (*labels);
 
       gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, title);
       gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (notebook), page, TRUE);
       gtk_notebook_set_tab_detachable (GTK_NOTEBOOK (notebook), page, TRUE);
-
+      
       if (packing == PACK_END ||
          (packing == PACK_ALTERNATE && count % 2 == 1))
        gtk_container_child_set (GTK_CONTAINER (notebook), page, "tab-pack", GTK_PACK_END, NULL);